package com.vlin.service.tuya;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
/*
 * 
 * devid 万能遥控器 id;
 * cid 万能遥控器支持的设备类型
 * pid 省份id
 * cityid 城市id
 * aid 区域id
 * oid 运营商 id
 * country_code 国际码 中国CN
 * bid 品牌id
 * lid 学习到红外id
 * gid 定时任务id
 * remoteId 遥控器id
 * */
public interface TuyaControlService {

	//获得万能遥控器支持的设备类型,目前只支持电视,机顶盒,空调
	@RequestMapping(name = "app/control/categories", method = RequestMethod.GET)
	public String getSupportDevCategories(@RequestParam(name="devid") String devid);
	
	//获得设备类型(万能遥控器支持的设备类型)下支持的品牌类型
	@RequestMapping(name = "app/control/categorie/brands", method = RequestMethod.GET)
	public String getCategorySupportBrands(@RequestParam(name="devid") String devid, @RequestParam(name="cid") String cid);
	
	//获得遥控器支持的省份列表
	@RequestMapping(name = "app/control/provinces", method = RequestMethod.GET)
	public String getSupportProvinces(@RequestParam(name="devid") String devid);
	
	//获得遥控器支持省份下的城市列表
	@RequestMapping(name = "app/control/province/cities", method = RequestMethod.GET)
	public String getProvinceCities(@RequestParam(name="devid") String devid, @RequestParam(name="pid") Integer pid);
	
	//获得遥控器支持城市下区域列表
	@RequestMapping(name = "app/control/province/city/areas", method = RequestMethod.GET)
	public String getCityArea(@RequestParam(name="devid") String devid, @RequestParam(name="pid") Integer pid, @RequestParam(name="cityid") Integer cityid);
	
	//获得遥控器区域 支持 运营商列表
	@RequestMapping(name = "app/control/province/city/area/iptvs", method = RequestMethod.GET)
	public String getAreaIptvs(@RequestParam(name="devid") String devid, @RequestParam(name="aid") String aid);
	
	//根据运营商获得品牌列表
	@RequestMapping(name = "app/control/operator/brands", method = RequestMethod.GET)
	public String getBrandByCountryCode(@RequestParam(name="devid") String devid, @RequestParam(name="oid") String oid, @RequestParam(name="countryCode") String countryCode);
	
	//获取IPTV 运营商下的遥控器索引列表
	@RequestMapping(name = "app/control/operator/brand/iptvs", method = RequestMethod.GET)
	public String getControlIndexByIptv(@RequestParam(name="devid") String devid, @RequestParam(name="oid") String oid, @RequestParam(name="bid") String bid);
	
	//获取非IPTV 运营商下的遥控器索引列表
	@RequestMapping(name = "app/control/operator/area/iptvs", method = RequestMethod.GET)
	public String getControlIndexByNoIptv(@RequestParam(name="devid") String devid, @RequestParam(name="oid") String oid, @RequestParam(name="aid") String aid);
	
	//获取品牌支持遥控器索引列表
	@RequestMapping(name = "app/control/category/area/iptvs", method = RequestMethod.GET)
	public String getControlIndexByBand(@RequestParam(name="devid") String devid, @RequestParam(name="cid") String cid, @RequestParam(name="bid") String bid);
	
	//获取红外设备下面绑定的遥控器列表
	@RequestMapping(name = "app/control/remotes", method = RequestMethod.GET)
	public String getBindControl(@RequestParam(name="devid") String devid);
	
	//向红外设备添加遥控器器（此接⼝口⽀支持IPTV机顶盒的添加
	@RequestMapping(name = "app/control/add-remote", method = RequestMethod.POST)
	public String addControl(@RequestParam(name="devid") String devid, @RequestParam(name="body") String body);
	
	//向红外设备添加普通遥控器
	@RequestMapping(name = "app/control/normal/add-remote", method = RequestMethod.POST)
	public String addCommonControl(@RequestParam(name="devid") String devid, @RequestParam(name="body") String body);
	
	//向红外设备添加机顶盒遥控器
	@RequestMapping(name = "app/control/boxnormal/add-remote", method = RequestMethod.POST)
	public String addSetTopBoxControl(@RequestParam(name="devid") String devid, @RequestParam(name="body") String body);
	
	//删除红外设备下的遥控器
	@RequestMapping(name = "app/control/remote", method = RequestMethod.GET)
	public String delControl(@RequestParam(name="devid") String devid, @RequestParam(name="remoteId") String remoteId);
	
	//删除红外设备下的遥控器
	@RequestMapping(name = "app/control", method = RequestMethod.POST)
	public String setControlName(@RequestParam(name="devid") String devid, @RequestParam(name="body") String body);
	
	//获取遥控器的配对规则
	@RequestMapping(name = "app/control/category/brand/remote/rules", method = RequestMethod.GET)
	public String getControlRules(@RequestParam(name="devid") String devid, @RequestParam(name="cid") String cid, @RequestParam(name="bid") String bid, @RequestParam(name="remoteIndex") String remoteIndex);
	
	//获取普通设备的红外码
	@RequestMapping(name = "app/control/category/remote/code", method = RequestMethod.GET)
	public String getSomeKeyInfraredCode(@RequestParam(name="devid") String devid, @RequestParam(name="cid") String cid, @RequestParam(name="remoteIndex") String remoteIndex, @RequestParam(name="key") String key);
	
	//获取普通设备的红外码
	@RequestMapping(name = "app/control/category/remote/all/code", method = RequestMethod.GET)
	public String getALLInfraredCode(@RequestParam(name="devid") String devid, @RequestParam(name="cid") String cid, @RequestParam(name="remoteIndex") String remoteIndex);
	
	//获取普通设备的红外码
	@RequestMapping(name = "app/control/category/remote/air/code", method = RequestMethod.GET)
	public String getAirConditionInfraredCode(@RequestParam(name="devid") String devid, @RequestParam(name="remoteIndex") String remoteIndex, @RequestParam(name="power") String power, @RequestParam(name="mode") String mode, @RequestParam(name="temp") String temp, @RequestParam(name="wind") String wind, @RequestParam(name="swing") String swing);
	
	//根据配对规则的key来下发红外码
	@RequestMapping(name = "app/control/send-keys", method = RequestMethod.POST)
	public String sendInfraredCodeByKey(@RequestParam(name="devid") String devid, @RequestParam(name="body") String body);
	
	
	//下发红外码
	@RequestMapping(name = "app/control/air/send-codes", method = RequestMethod.POST)
	public String sendInfraredCode(@RequestParam(name="devid") String devid, @RequestParam(name="remoteId") String remoteId);
	
	//下发空调红外码
	@RequestMapping(name = "app/control/air/send-codes", method = RequestMethod.POST)
	public String sendAirConditionInfraredCode(@RequestParam(name="devid") String devid, @RequestParam(name="remoteId") String remoteId);
	
	//同步空调当前状态
	@RequestMapping(name = "app/control/sync/air/status", method = RequestMethod.GET)
	public String getAirConditionStatu(@RequestParam(name="devid") String devid, @RequestParam(name="remoteId") String remoteId);
	
	//遥控器进入学习状态
	@RequestMapping(name = "app/control/learning", method = RequestMethod.GET)
	public String controlLearning(@RequestParam(name="devid") String devid);
	
	//查询学习到的红外码
	@RequestMapping(name = "app/control/learning/select", method = RequestMethod.GET)
	public String selectLearnedInfraredCode(@RequestParam(name="devid") String devid, @RequestParam(name="time") String time);
	
	//保存学习到的红外码
	@RequestMapping(name = "app/control/code-save", method = RequestMethod.POST)
	public String saveLearnedInfraredCode(@RequestParam(name="devid") String devid, @RequestParam(name="codes") String codes);
	
	//获取学习到的红外码
	@RequestMapping(name = "app/control/learn/get", method = RequestMethod.GET)
	public String getLearnedInfraredCode(@RequestParam(name="devid") String devid, @RequestParam(name="remoteId") String remoteId);
	
	//更新学习的遥控器
	@RequestMapping(name = "app/control/learn/update", method = RequestMethod.POST)
	public String updateLearned(@RequestParam(name="devid") String devid, @RequestParam(name="codes") String codes, @RequestParam(name="remoteId") String remoteId);
	
	//退出学习模式
	@RequestMapping(name = "app/control/learn/quit", method = RequestMethod.GET)
	public String exitLearningMode(@RequestParam(name="devid") String devid);
	
	//删除学习到的红外码
	@RequestMapping(name = "app/control/learn/code/delete", method = RequestMethod.GET)
	public String delLearnedInfraredCode(@RequestParam(name="devid") String devid, @RequestParam(name="lid") Long lid);
	
	//添加定时任务
	@RequestMapping(name = "app/control/timer", method = RequestMethod.POST)
	public String addInfraredCodeTimer(@RequestParam(name="devid") String devid, @RequestParam(name="body") String body);
	
	//添加定时任务
	@RequestMapping(name = "app/control/timer/add", method = RequestMethod.GET)
	public String getInfraredCodeTimer(@RequestParam(name="devid") String devid, @RequestParam(name="cid") String cid, @RequestParam(name="remoteId") String remoteId);
	
	//更新红外遥控器的定时任务
	@RequestMapping(name = "app/control/timer/update", method = RequestMethod.POST)
	public String updateInfraredCodeTimer(@RequestParam(name="devid") String devid,@RequestParam(name="devid") String gid, @RequestParam(name="body") String body);
	
	//根据定时id删除定时任务
	@RequestMapping(name = "app/control/timer/delete", method = RequestMethod.GET)
	public String delTimerByGid(@RequestParam(name="devid") String devid, @RequestParam(name="gid") String gid);
	
	//删除全部定时任务
	@RequestMapping(name = "app/control/timer/all/delete", method = RequestMethod.GET)
	public String delAllTimer(@RequestParam(name="devid") String devid);
	
}
